跳到主要内容

ToFixed

Converts the current form to a fixed size form.

Syntax

expression.ToFixed(width, height, keepPosition);

expression - A variable that represents a ApiPictureForm class.

Parameters

NameRequired/OptionalData typeDefaultDescription
widthRequiredtwipsThe wrapper shape width measured in twentieths of a point (1/1440 of an inch).
heightRequiredtwipsThe wrapper shape height measured in twentieths of a point (1/1440 of an inch).
keepPositionRequiredbooleanSave position on the page (it can be a little bit slow, because it runs the document calculation)

Returns

boolean

Example

This example converts the form to a fixed size form.

let doc = Api.GetDocument();
let textForm = Api.CreateTextForm({"key": "Personal information", "tip": "Enter your first name", "required": true, "placeholder": "First name", "comb": true, "maxCharacters": 10, "cellWidth": 3, "multiLine": false, "autoFit": false});
let paragraph = doc.GetElement(0);
paragraph.AddElement(textForm);
textForm.ToFixed(10 * 240, 2 * 240);
let fixed = textForm.IsFixed();
paragraph = Api.CreateParagraph();
paragraph.AddText("The first form from this document has a fixed size: " + fixed);
doc.Push(paragraph);